package com.zyh.controller;


import com.zyh.entity.*;
import com.zyh.service.BookService;
import com.zyh.service.Menuservice;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.ResponseBody;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

@Controller
@CrossOrigin
public class MenuController {

    @Autowired
    private Menuservice menuservice;

    @GetMapping("/getAllmenu/{id}")
    @ResponseBody
    public List<Menu> getAllmenu(@PathVariable("id") Integer mid) {
       return menuservice.getAllmenu(mid);
    }

    @GetMapping("/getAllmessages/{id}")
    @ResponseBody
    public List<Messagefather> getAllmessages(@PathVariable("id") Integer mid) {
        return menuservice.getAllmessages(mid);

    }
}
